from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import BannerViewSet, TechnicianViewSet, ServiceViewSet, ImageViewSet

# 创建路由器并注册视图集
router = DefaultRouter()
router.register(r'banners', BannerViewSet, basename='banners')
router.register(r'technicians', TechnicianViewSet, basename='technicians')
router.register(r'services', ServiceViewSet, basename='services')

urlpatterns = [
    path('', include(router.urls)),
    path('app-images/', ImageViewSet.as_view({'get': 'app_images'}), name='app_images'),
    path('banners/upload_image/', BannerViewSet.as_view({'post': 'upload_image'}), name='banner_upload_image'),
]